﻿using System;
using System.Text.RegularExpressions;

namespace 小说爬取
{
    /// <summary>
    ///爬取小说地址 https://www.nitianxieshen.com/nitianxieshen/
    /// </summary>

    public class Citianxieshen : HtmlParse
    {
        /// <summary>
        /// 网站小说名称CSS路径
        /// </summary>
        private static NameSelector NameSelector { get; }

        /// <summary>
        /// 章节列表 CSS选择器
        /// </summary>
        private static ChapterSelector ChapterSelector { get; }

        /// <summary>
        /// 小说章节内容 选择器
        /// </summary>
        private static string TextSelector { get; }

        /// <summary>
        /// 广告过滤
        /// </summary>
        private static string Filtration { get; }

        static Citianxieshen()
        {
            NameSelector = new NameSelector("div[class=m-infos]>h1");
            ChapterSelector = new ChapterSelector("li[class=line3]>a[href]", UriHelper.Join, "div[id=play_0]");
            TextSelector = "div[id=content]";
            Filtration = @"\s*上一章[\S\s]{50,150}码阅读.\s*";
        }

        public Citianxieshen(Uri uri) : base(uri, NameSelector, ChapterSelector, TextSelector, Filtration)
        {
        }
    }
}